package com.bytedance.article.common.a.d;

import android.support.annotation.NonNull;

import com.bytedance.frameworks.core.thread.e;

import java.util.LinkedList;

import org.json.JSONArray;
import org.json.JSONObject;

final class d extends com.bytedance.frameworks.core.thread.e {
    private final com.bytedance.article.common.a.d.c a;

    d(c arg1) {
        this.a = arg1;
    }

    public final void run() {
        Object v2;
        LinkedList v1;
        try {
            v1 = new LinkedList();
            v2 = com.bytedance.article.common.a.d.c.d();
            synchronized (v2) {
                v1.addAll(com.bytedance.article.common.a.d.c.a(this.a));
                com.bytedance.article.common.a.d.c.a(this.a).clear();
                com.bytedance.article.common.a.d.c.b(this.a);
            }
            if (v1.isEmpty()) {
                return;
            }

            JSONObject v2_1 = new JSONObject();
            JSONArray v3 = new JSONArray();
            while (!v1.isEmpty()) {
                Object v0_1 = v1.poll();
                if (v0_1 == null) {
                    continue;
                }

                v3.put(new JSONObject(((c.a) v0_1).b));
            }

            v2_1.put("data", v3);
            if (com.bytedance.article.common.a.d.c.c(this.a) == null) {
                com.bytedance.article.common.a.d.c.a(this.a, com.bytedance.framwork.core.monitor.c.j().l());
            }
            v2_1.put("header", com.bytedance.article.common.a.d.c.c(this.a));
            com.bytedance.article.common.a.d.c.a(this.a, "http://abn.snssdk.com/collect/", v2_1.toString());
        } catch (Throwable v0) {

            v0.printStackTrace();
        }
    }

    @Override
    public void f(@NonNull Object o) {

    }
}

